//
//  SEGCardTencentCell.m
//  SEGActivity
//
//  Created by 山刘 on 2020/8/5.
//

#import "SEGCardTencentCell.h"

@interface SEGCardTencentCell ()
@end

@implementation SEGCardTencentCell
#pragma mark - Life Cycle
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.layer.cornerRadius = 8.0f;
        self.layer.masksToBounds = true;
        [self segInitViews];
    }
    return self;
}

#pragma mark - Layout
- (void)updateConstraints {
    [super updateConstraints];
}

-(void)layoutSubviews {
    [super layoutSubviews];
    self.adView.frame = self.contentView.bounds;
}

#pragma mark - Public Methods

#pragma mark - Private Methods

+(NSString*)reuseIdentifier{
    return NSStringFromClass([self class]);
}

-(void)segInitViews{
    // self.contentView addSubview
    self.adView = [[SEGCardTencentView alloc] init];
    [self.contentView addSubview:self.adView];
    // masonry...
}

- (void)prepareForReuse {
    [super prepareForReuse];
    
    [self.adView unregisterDataObject]; // unregister 必须执行，为了 cell 复用。
    self.adView.imageView.image = nil;
    self.adView.imageView.accessibilityIdentifier = @"imageView_id";
}

#pragma mark - UITraitEnvironment
- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
    [super traitCollectionDidChange:previousTraitCollection];
    self.adView.layer.borderColor = kColor_L4.CGColor;
}

#pragma mark - RAC Data Binding
- (void)bindViewModel {
}

#pragma mark - getter
#pragma mark setter
@end
